package entity;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/*宠物*/
public class Pet {
    private static final Logger LOGGER = LoggerFactory.getLogger(Pet.class);

    // 宠物
    public Pet() {}

    // 宠物名
    private String petName;
    // 年龄
    private int age;

    // 自我介绍
    public void introduce() {
        System.out.println("宠物名：" + this.petName + " 年龄：" +this.age);
    }

    // 封装
    public String getPetName() {
        return petName;
    }

    public void setPetName(String petName) {
        this.petName = petName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        LOGGER.debug("Pet对象的setAge方法被调用!参数age={}",age);
        this.age = age;
    }
}
